/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* getRow(int rowIndex, int* returnSize)
{
    int** arr = (int**)malloc(sizeof(int*) * (34));
    for (int i = 0; i < 34; i++)
        arr[i] = (int*)malloc(sizeof(int) * (i + 1));
    for (int i = 0; i < 34; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            if (j == 0 || j == i)
                arr[i][j] = 1;
            else
                arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
        }
    }
    *returnSize = rowIndex + 1;
    return arr[rowIndex];
}